
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Raphaël · Tiger</title>
<script src="raphael.js"></script>
<script src="work.js"></script>
<script>

seen = [];


window.onload = function () {

	 Raphael(0, 0, 2000, 2000, function () {
         var r = this;
         r.rect(0, 0, 2000, 2000, 10).attr({
             stroke: "none",
             fill: "0-#FFFFFF-#adc8da"
         });
         var over = function () {
        	 //console.log("over");
        	if(this.id==1){
		 
		 }else{
             this.c = this.c || this.attr("fill");
             this.attr({fill: "#bacabd",opacity: 0.1});
         }
         },
             out = function () {
        	 //console.log("out");
                 this.attr({fill: this.c});
             };
         r.setStart();
         var hue = Math.random();
         var ii=1;
         r.image("../assets/ZonenPlanGanzv2.jpg", 4, 4, 1180, 830);
         for (var yay in worldmap) {
           	// console.log(JSON.stringify(yay));
           	//console.log(worldmap[yay].path);
           	if(worldmap[yay].path){
           		//console.log(worldmap[yay].path);
            	 r.path(worldmap[yay].path).attr({fill: "0-#FFFFFF-#FFFFFF", opacity: 0});
           	}

            }
        
  /*        for (var id in worldmap) {
             // var c = Raphael.hsb(Math.random(), .5, .75);
             // var c = Raphael.hsb(.11, .5, Math.random() * .25 - .25 + .75);
            console.log(worldmap[yay].path);
             r.path(worldmap[id].path).attr({id: ii, stroke: "#ccc6ae", fill: "#f0efeb", "stroke-opacity": 0.25});
             ii++;
         } */
         var world = r.setFinish();
         world.hover(over, out);
        
       // world.mouseover(over);
       // world.mouseout(out);
       /*   world.mousemove(function () {
         	//console.log(this);
         });  */
         world.click(function () {
        	//alert(this.id);
        	 //console.log(this.id);
        	 this.attr({fill: "#F00"});
        	 this.c ="#A00";
        	 

        	/*  console.log(JSON.stringify(this, function(key, val) {
        		   		if (typeof val == "object") {
        		        	if (seen.indexOf(val) >= 0)
        		            	return
        		        	seen.push(val);
        		    	}
        		    	return val})
        		    );*/
         }); 
         
    });
};
</script>
</head>
<body>
	<div id="holder"></div>
	<p id="copy">
		Demo of <a href="http://raphaeljs.com/">Raphaël</a>—JavaScript Vector
		Library
	</p>
</body>
</html>
